import { $http } from '@escook/request-miniprogram'

const request = $http

// $http.baseUrl = 'https://xiaoqq.cn:9003/SpecialCenterPlatformService'
$http.baseUrl = 'http://101.200.38.7:8888'
// $http.baseUrl = 'https://www.qzjljd.com/api'	

//请求拦截器
$http.beforeRequest = function(options) {
  //   const { url } = options
  
  //   if (!url.endsWith("/Auth/Login")) {
  //       //如果失效直接跳到登陆界面
  //       const expireTime = uni.getStorageSync("expireTime")
  //       if (expireTime && expireTime > new Date().getTime()) {
  //          uni.navigateTo({
  //              url:"/pages/login/index"
  //          })
  //       }
  //       uni.showLoading({
  //           title: "数据加载中..."
  //       })
  //   }
}

//响应拦截器
$http.afterRequest = function(res) {
    uni.hideLoading()
}

export default request